from nicegui import ui

from views.tabs.socialview import SocialView
from views.tabs.streetview import StreetView


class HeaderView:
    def __init__(self,left_drawer:ui.left_drawer) -> None:
        with ui.header().classes(replace='row items-center') as header:
            ui.button(on_click=lambda: left_drawer.toggle(), icon='menu').props('flat color=white')
            with ui.tabs() as tabs:
                streetview = ui.tab('街景数据采集')
                socialview = ui.tab('社交媒体数据采集')
                self.tabs = tabs
        with ui.tab_panels(self.tabs,value='街景数据采集').classes('w-full'):
            with ui.tab_panel(streetview):
                self._init_streetviewgrabber()
            with ui.tab_panel(socialview):
                self._init_socialviewgrabber()
    def _init_streetviewgrabber(self):
        # log clicked
        StreetView(self.tabs,"街景数据采集")
        
    def _init_socialviewgrabber(self):
        SocialView(self.tabs,"社交媒体数据采集")
        
        
    